
package com.elong.common.http;

import java.util.List;

import org.apache.commons.httpclient.HttpStatus;
import org.apache.http.cookie.Cookie;

/**
 * HttpResult
  * @Title: HttpResult
  * @Desription 返回结果
  * @author Guanguo.Gao
  * @date 2015年2月3日 下午3:13:40
 */
public class HttpResult {

    //返回码
    private int retCode;
    
    //返回内容
    private String retContent;
    
    //redirect url 跳转后的url
    private String redirectUrl;
    
    //访问后的cookie
    private String cookie;  
    
    private List<Cookie> cookies;

    public int getRetCode() {
        return retCode;
    }

    public void setRetCode(int retCode) {
        this.retCode = retCode;
    }

    /**
     * getter method for retContent
     * @return the retContent
     */
    public String getRetContent() {
        return retContent;
    }

    /**
     * setter method for retContent
     * @Description the retContent to set
     * @param retContent 
     */
    public void setRetContent(String retContent) {
        this.retContent = retContent;
    }

    public String toString(){
        return "retCode:" + retCode + System.getProperty("line.separator") 
                + "retDesc: " + retContent + System.getProperty("line.separator")
                + "redirectUrl: " + redirectUrl;
    }

    public String getRedirectUrl() {
        return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    public String getCookie() {
        return cookie;
    }

    public void setCookie(String cookie) {
        this.cookie = cookie;
    }

    public List<Cookie> getCookies() {
        return cookies;
    }

    public void setCookies(List<Cookie> cookies) {
        this.cookies = cookies;
    }
    
    /**
     * isResultOk
      * @Title: isResultOk
      * @Description: 是否成功
      * @return
     */
    public boolean isResultOk() {
	return this.retCode == HttpStatus.SC_OK;
    }
    
}
